5 // Created by Evan Schoenberg on 8/7/06.
8 #import "ESPurpleQQAccount.h"
11 @implementation ESPurpleQQAccount
13 - (const char*)protocolPlugin
18 - (void)configurePurpleAccount
20 [super configurePurpleAccount];
22 purple_account_set_bool(account, "use_tcp", [[self preferenceForKey:KEY_QQ_USE_TCP group:GROUP_ACCOUNT_STATUS] boolValue]);
26 * @brief The server name to be passed to libpurple
27 * QQ prpl will choose a server randomly for load balancing if we don't pass one, so do that. -[self host] returns the first server
28 * for host reachability checking purpoes.
30 - (NSString *)hostForPurple
32 NSString *specifiedHost = [self preferenceForKey:KEY_CONNECT_HOST group:GROUP_ACCOUNT_STATUS];
33 return (specifiedHost ? specifiedHost : nil);
38 /* This is not technically right, since the qq plugin randomly chooses one of many different servers at connect time.
39 * "sz.tencent.com" or "sz#.tencent.com" for UDP
40 * "tcpconn.tencent.com" or "tcpconn#.tencent.com" where (# <= 6) for TCP.
41 * Specifying the host is important for network reachability checking, though, and generally all hosts should be up if one is reachable.
43 NSString *host = [self hostForPurple];
45 host = ([[self preferenceForKey:KEY_QQ_USE_TCP group:GROUP_ACCOUNT_STATUS] boolValue] ? @"tcpconn.tencent.com" : @"sz.tencent.com");
50 #pragma mark Account Action Menu Items
51 - (NSString *)titleForAccountActionMenuLabel:(const char *)label
53 if (label && (strcmp(label, _("Modify my information")) == 0)) {
54 return AILocalizedString(@"Modify My Information", "Menu title for configuring the public information for a QQ account");
57 return [super titleForAccountActionMenuLabel:label];